import {createStore} from 'vuex'
import {getItem,setItem} from '../utils/storage'
const  TOKEY_KEY = "HUSBAND_LELE"
const store  = createStore({
    state:{
        //user:JSON.parse(window.localStorage.getItem(TOKEY_KEY))
        user:getItem(TOKEY_KEY)
    },
    mutations:{
        setUser(state,data){
            state.user = data;
            //window.localStorage.getItem(TOKEY_KEY,JSON.stringify(state.user));
            setItem(TOKEY_KEY,state.user);
        },
    },
});

export default store